package com.objetdirect.gwt.umldrawer.server.services;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.objetdirect.gwt.umldrawer.server.dao.ProfilePictureDao;
import com.objetdirect.gwt.umldrawer.shared.services.ProfilePictureService;

@Service("profilePictureService")
public class ProfilePictureServiceImpl implements ProfilePictureService {

	@Autowired
	private ProfilePictureDao profilePictureDAO;

	@PostConstruct
	public void init() throws Exception {
	}

	@PreDestroy
	public void distroy() {
	}
//
//	@Override
//	@Transactional (propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
//	public void uploadProfilePicture(String developerEmail, String picturePath)
//			throws Exception {
//		
//		DeveloperDTO developer = new DeveloperDTO(developerEmail);
//		ProfilePictureDTO profilePicture = new ProfilePictureDTO(picturePath, developer);
//		profilePictureDAO.persist(profilePicture);
//	}

	@Override
	@Transactional (propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
	public String getProfilePicturePath(String developerEmail) throws Exception {
		
		return null;
	}

	@Override
	public void uploadProfilePicture(String developerEmail, String picturePath)
			throws Exception {
		// TODO Auto-generated method stub
		
	}

}
